package com.coldtech.circlecrash.handler;

import java.awt.event.MouseEvent;
import java.awt.event.MouseMotionListener;

import com.coldtech.circlecrash.CircleCrash;

public class MouseMotionHandler implements MouseMotionListener {
	private CircleCrash game;

	public MouseMotionHandler(CircleCrash game) {
		this.game = game;
		this.game.addMouseMotionListener(this);
	}

	public void mouseDragged(MouseEvent e) {
		this.game.getButtonHandler().hover(e.getX(), e.getY());
		if (this.game.getSelection().isSelecting()) {
			this.game.getSelection().updateSelection(e.getX(), e.getY());
		}
	}

	public void mouseMoved(MouseEvent e) {
		this.game.getButtonHandler().hover(e.getX(), e.getY());
	}

}
